import axios from 'axios';
axios.defaults.withCredentials = true

export const url = `http://localhost:9090/store`
export const uploadFileUrl = `${url}/fileUtils/uploadFile`
export const uploadPicUrl = `${url}/fileUtils/uploadPicUrl`
export const showUrl = url+"/images/"

//登录
export const requestLogin = params => { return axios.post(`${url}/login/login`, params).then(res => res.data) }
export const register = params => { return axios.post(`${url}/user/register`, params).then(res => res.data) }
export const updatePassword = params => { return axios.post(`${url}/user/updatePassword`, params).then(res => res.data) }

export const queryAreaList = params => { return axios.post(`${url}/area/queryAreaList`, params).then(res => res.data) }

//用户相关
export const updateUser = params => { return axios.post(`${url}/user/updateUser`, params).then(res => res.data) }
export const delUser = params => { return axios.post(`${url}/user/delUser`, params).then(res => res.data) }
export const queryUser = params => { return axios.post(`${url}/user/queryUser`, params).then(res => res.data) }
export const queryUserByPage = params => { return axios.post(`${url}/user/queryUserByPage`, params).then(res => res.data) }
export const queryUserById = params => { return axios.post(`${url}/user/queryUserById`, params).then(res => res.data) }

//store
export const updateStore = params => { return axios.post(`${url}/store/updateStore`, params).then(res => res.data) }
export const delStore = params => { return axios.post(`${url}/store/delStore`, params).then(res => res.data) }
export const queryStore = params => { return axios.post(`${url}/store/queryStore`, params).then(res => res.data) }
export const queryStoreByPage = params => { return axios.post(`${url}/store/queryStoreByPage`, params).then(res => res.data) }
export const queryStoreById = params => { return axios.post(`${url}/store/queryStoreById`, params).then(res => res.data) }
export const statistic = params => { return axios.post(`${url}/store/statistic`, params).then(res => res.data) }

//notice
export const updateNotice = params => { return axios.post(`${url}/notice/updateNotice`, params).then(res => res.data) }
export const delNotice = params => { return axios.post(`${url}/notice/delNotice`, params).then(res => res.data) }
export const queryNotice = params => { return axios.post(`${url}/notice/queryNotice`, params).then(res => res.data) }
export const queryNoticeByPage = params => { return axios.post(`${url}/notice/queryNoticeByPage`, params).then(res => res.data) }
export const queryNoticeById = params => { return axios.post(`${url}/notice/queryNoticeById`, params).then(res => res.data) }

//noticeUser
export const updateNoticeUser = params => { return axios.post(`${url}/noticeUser/updateNoticeUser`, params).then(res => res.data) }
export const delNoticeUser = params => { return axios.post(`${url}/noticeUser/delNoticeUser`, params).then(res => res.data) }
export const queryNoticeUser = params => { return axios.post(`${url}/noticeUser/queryNoticeUser`, params).then(res => res.data) }
export const queryNoticeUserByPage = params => { return axios.post(`${url}/noticeUser/queryNoticeUserByPage`, params).then(res => res.data) }
export const queryNoticeUserById = params => { return axios.post(`${url}/noticeUser/queryNoticeUserById`, params).then(res => res.data) }

//message
export const updateMessage = params => { return axios.post(`${url}/message/updateMessage`, params).then(res => res.data) }
export const delMessage = params => { return axios.post(`${url}/message/delMessage`, params).then(res => res.data) }
export const queryMessage = params => { return axios.post(`${url}/message/queryMessage`, params).then(res => res.data) }
export const queryMessageByPage = params => { return axios.post(`${url}/message/queryMessageByPage`, params).then(res => res.data) }
export const queryMessageById = params => { return axios.post(`${url}/message/queryMessageById`, params).then(res => res.data) }
